
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>转正管理</title>
<script type="text/javascript" src="static/easyui/jquery.min.js"></script>
<script type="text/javascript" src="static/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="static/easyui/locale/easyui-lang-zh_CN.js"></script>
<link rel="stylesheet" href="static/easyui/themes/icon.css">
<link rel="stylesheet" href="static/easyui/themes/metro/easyui.css">
	<style type="text/css">
		/* 待转正里面的按钮 */
		.qdzz{
			color: #19AA8D;
			border: 1px solid #19AA8D;
		}
		.zz-shanchu{
			border: 1px solid #19AA8D;
			color: #19AA8D;
		}
		/* 审批里面的按钮样式 */
		.ck{
			color: #1AB394;
			border: 1px solid #19AA8D;
		}
		.jieguo-ck{
			color: #1AB394;
			border: 1px solid #19AA8D;
		}
	</style>
	
</head>
<body>
<script type="text/javascript">
		function shenqzhuanz(bwr_id){
			alert(bwr_id);
			$("#shenqingform").form('load','become-id?bwr_id='+bwr_id);
			$("#becomeaa").window("open");	
			$("#become-gb").linkbutton({onClick : function(){
				$("#becomeaa").window("close");
			}});
		}
		$(function(){
			$('#become-table').datagrid({
			    url:'become-list',
			    columns:[[
					{field:'bwr_id',checkbox:true,title:'编号',width:100,align:'center'},
					{field:'staffId',title:'员工工号',width:150,align:'center'},
					{field:'staff_name',title:'员工名称',width:150,align:'center'},
					{field:'staff_sex',title:'性别',width:150,align:'center'},
					{field:'staff_phone',title:'手机号',width:150,align:'center'},
					{field:'dateentry',title:'入职日期',width:150,align:'center'},
					{field:'depart_name',title:'部门',width:150,align:'center'},
					{field:'tryEndDate',title:'试用期到期日期',width:150,align:'center'},
					{field:'bwr_Date',title:'转正日期',width:150,align:'center'},
					{field:'bwr_state',title:'审核状态',width:150,align:'center'},
					{field:'caozuo',title:'操作',width:250,align:'center',
						formatter: function(value,row,index){
							return "<input type='button' onclick='shenqzhuanz("+row['bwr_id']+")'  style='width: 80px;height: 20px;font-size:12px;border-radius:4px;margin-right:5px;color:#fff;background-color:#18A689;border:1px solid #18A689;' value='申请转正'/>";
						},
					}
			    ]],
			    pagination:true,
			    pageNumber:1,
			    pageSize:5,
			    pageList:[5,10,15]
			});
			
			//申请转正审核ajax
			$("#become-qianding").linkbutton({onClick : function(){
				alert($("#bwr_id").textbox("getValue"));
				  $.ajax({
			         type:"post",//type可以为post也可以为get
			         url:"become-states",
			         data:{bwr_id:$("#bwr_id").textbox("getValue")
			        	   },
			         success:function(data){
			        	 $("#become-table").datagrid("reload");
			             $("#becomeaa").window("close");
			             console.log('callBack~~~');
			         }
			     });
				
			}});  
			
			//查询结果
			$('#jieguo-table').datagrid({
			    url:'become-jieguo',
			    columns:[[
					{field:'bwr_id',title:'编号',width:100,align:'center'},
					{field:'staffId',title:'员工工号',width:150,align:'center'},
					{field:'staff_name',title:'员工名称',width:150,align:'center'},
					{field:'staff_sex',title:'性别',width:150,align:'center'},
					{field:'staff_phone',title:'手机号',width:150,align:'center'},
					{field:'dateentry',title:'入职日期',width:150,align:'center'},
					{field:'depart_name',title:'部门',width:150,align:'center'},
					{field:'tryEndDate',title:'试用期到期日期',width:150,align:'center'},
					{field:'bwr_Date',title:'转正日期',width:150,align:'center'},
					{field:'bwr_state',title:'审核状态',width:150,align:'center'},
					{field:'caozuo',title:'操作',width:250,align:'center',
						formatter: function(value,row,index){
							return "<input type='button'  style='width: 80px;height: 20px;font-size:12px;border-radius:4px;margin-right:5px;color:#fff;background-color:#18A689;border:1px solid #18A689;' value='查看'/>";
						},
					}
			    ]],
			    pagination:true,
			    pageNumber:1,
			    pageSize:5,
			    pageList:[5,10,15]
			});
		});
	</script>
	<div id="tt" class="easyui-tabs" style="height:560px;">
	
	
	    <div title="转正审批" style="display:none;">
				<table id="become-table" class="easyui-datagrid" style="height: 500px">   
				</table>  
	    </div>
	    
	    <div title="转正结果"style="display:none;">
			
			<table id="jieguo-table" class="easyui-datagrid" style="height:500px">   
				   
				</table>
				
	    </div>
	    
</div>
	
	<div id="becomeaa" class="easyui-window" title="签订" style="width:800px;height:300px;" 
		data-options="modal:true,collapsible:false,minimizable:false,maximizable:false,closed:true,draggable:false">
			<Form  action="" id="shenqingform" method="post">
		        	<table width="600px" style="padding: 5px 5px 2px 3px;height:130px;">
		        		<tr>
		        			<td><input id="bwr_id"  name="bwr_id" class="easyui-textbox" data-options="label:'编号',width:280,labelAlign:'right',required:true"/></td>
		        			<td><input  name="staffId" class="easyui-textbox" data-options="label:'员工工号',width:280,labelAlign:'right',required:true"/></td>
		        		</tr>
		        		<tr>
		        			<td><input  name="tryEndDate" class="easyui-datebox" data-options="label:'试用期结束日期',width:280,labelAlign:'right',required:true,editable:false"/></td>
							<td><input  name="staff_name" class="easyui-textbox" data-options="label:'员工名称',width:280,labelAlign:'right',required:true"/></td>
						</tr>
						<tr>
							<td><input  name="bwr_Date" class="easyui-datebox" data-options="label:'转正日期',width:280,labelAlign:'right',required:true,editable:false"/></td>
							<td><input  name="bwr_time" class="easyui-datebox" data-options="label:'提交时间',width:280,labelAlign:'right',required:true,editable:false"/></td>
						</tr>
		        		<tr>
		        			
		        			<td><input  name="bwr_state" class="easyui-textbox"  data-options="label:'审核状态',width:280,labelAlign:'right',required:true"/></td>
		        		</tr>
		        	</table>
		        	<div style="text-align: center;margin: 10px 1px 1px 1px">
					<a id="become-gb" class="easyui-linkbutton" data-options="width:100">取消</a>
					<a id="become-qianding"  class="easyui-linkbutton" data-options="width:100">确定转正</a>
					</div>
				 </Form>
		</div>
</body>
</html>